import request from '@/utils/request'

export function VideoSearch(data, urlData) {
  var queryString = ''
  if (urlData !== '') {
    queryString = '?' + urlData
  }
  return request({
    url: '/Video/Search' + queryString,
    method: 'POST',
    data
  })
}

export function Video(method, value) {
  let url = ''
  let data = null
  method = method.toLocaleUpperCase()
  if (method === 'POST') {
    // url = "/SafetyCatSetting/firstOne"
    url = '/Video'
    data = value
  } else if (method === 'PUT') {
    url = '/Video/' + value.id + '?' + value.code
    data = value.value
  } else if (method === 'DELETE') {
    url = '/Video/' + value.id + '?' + value.code
  }

  return request({
    url,
    method,
    data
  })
}
